package cn.com.bsoft.immunity.model

import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement
import java.math.BigDecimal
import java.util.*

@JacksonXmlRootElement(localName = "paymentReq")
class PaymentRequest{

    @JacksonXmlProperty(localName = "orgId")
    var hospitalCode:String? = null

    @JacksonXmlProperty(localName = "beginTime")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    var begin: Date? = null

    @JacksonXmlProperty(localName = "endTime")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    var end: Date? = null

}

@JacksonXmlRootElement(localName = "paymentResult")
class PaymentResponse{

    @JacksonXmlProperty(localName = "code")
    var code:String? = null
    @JacksonXmlProperty(localName = "msg")
    var msg:String? = null
    @JacksonXmlProperty(localName = "payContents")
    var payContents:List<PaymentContent>? = null

}

@JacksonXmlRootElement(localName = "payContent")
class PaymentContent{
    @JacksonXmlProperty(localName = "payNo")
    var payNo:String? = null
    @JacksonXmlProperty(localName = "cardNo")
    var cardNo:String? = null
    @JacksonXmlProperty(localName = "name")
    var name:String? = null
    @JacksonXmlProperty(localName = "InvoiceNo")
    var InvoiceNo:String? = null
    @JacksonXmlProperty(localName = "payTime")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    var payTime:Date? = null
    @JacksonXmlProperty(localName = "payType")
    var payType:Int? = null
    @JacksonXmlElementWrapper(localName = "items")
    @JacksonXmlProperty(localName = "item")
    var items:List<PaymentItem>? =null

}

@JacksonXmlRootElement(localName = "item")
class PaymentItem{
    @JacksonXmlProperty(localName = "code")
    var code:String? = null
    @JacksonXmlProperty(localName = "title")
    var title:String? = null
    @JacksonXmlProperty(localName = "price")
    var price:BigDecimal? = null
}


